package com.gcb.controller;

import com.gcb.pojo.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @Author 35235
 * @Date 2021/8/8 17:31
 * @Version 1.0
 */
@RequestMapping("/login")
@RestController
public class LoginController {
    @RequestMapping("/check.do")
    public boolean check(@RequestBody User user , HttpSession session){
       session.setAttribute("username",user.getUsername());
        System.out.println(user);

        return true;
    }
    @RequestMapping("/logout")
    public void  check(HttpSession session
    /*HttpRequest request*/){
        session.invalidate();
        /*request.getSession()*/
    }
}
